﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

public class ExaminationShot : Examination
{
    protected override void Start()
    {
        base.Start();
    }
    protected override void Update()
    {
        base.Update();

    }
    public override void OnSucceed()
    {
        base.OnSucceed();
        if (m_TimeCount < m_TimeBigSucceedMax)
        {
            m_BigSucceedSound.Play();
            Player.Instance.DriveLicenseState[(int)m_DriveLevel, 1] = (int)Driver.LicenseEvaluate.NIU_BI;
        }
        else 
        {
            m_SucceedSound.Play();
            if (Player.Instance.DriveLicenseState[(int)m_DriveLevel, 1] == (int)Driver.LicenseEvaluate.NOT_PASS)
                Player.Instance.DriveLicenseState[(int)m_DriveLevel, 1] = (int)Driver.LicenseEvaluate.PASS;
        }
        Player.Instance.save();
    }
    protected override void OnLose()
    {
        base.OnLose();
    }
    protected override void CheckComplete()
    {
        if (!m_Start)
            return;

        // Succeed
        if (TargetObj == null)
        {
            OnSucceed();
        }

        //  Lose
        if (m_Control.ControlShp == null)
        {
            OnLose();
        }
        if (m_TimeCount > m_TimeMax)
        {
            m_TimeCountL.color = new Vector4(1, 0, 0, 1);
            m_Start = false;
            OnLose();
        }
    }
}